<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= @page_title || ARTICLE_TITLE %></title>
	<%= javascript_include_tag :defaults %>
	<%= stylesheet_link_tag 'reset', 'fonts', 'layout', 'article' %>
</head>
<body>
	
	<div id="header">
		<ul id="menu" class="clearfix">
			<li><%= link_to "#{image_tag('16x16/blog.png', :size => '16x16')} Blog", { :controller => 'blog' } %></li>
			<li><%= link_to "#{image_tag('16x16/articles.png', :size => '16x16')} Articles", { :controller => 'article' }, { :class => 'current' } %></li>
			<% if session[:user].nil? -%>
				<li><%= link_to_remote "#{image_tag('16x16/admin.png', :size => '16x16')} Log In", { :url => { :action => :show_login } }, { :href => url_for(:controller => 'login') } %></li>
			<% else -%>
				<li><%= link_to "#{image_tag('16x16/admin.png', :size => '16x16')} Admin", { :controller => 'admin' } %></li>
			<% end -%>
		</ul>
	</div>
	
	<div id="container" class="clearfix">
		<div id="content">
			<%= yield %>
		</div>
		
		<div id="sidebar">
			<div class="section">
				<h2>About</h2>
				This is the site of Stephen Gerstacker.  You can learn more 
				<%= link_to 'About My Site',:controller => :article, :action => :view, :title => 'About My Site' %>
				 if you'd like.
			</div>
			
			<% unless session[:user].nil? || @article_controls.blank? -%>
				<h3>Article Controls</h3>
				<ul>
					<% @article_controls.each do |control| -%>
						<li><%= control %></li>
					<% end -%>
				</ul>
			<% end -%>
			
			<% if @show_tags -%>
				<% cache(:controller => 'article', :action => 'index', :name => 'tag_cloud') do -%>
					<h3>Tags</h3>
					<p><%= tag_cloud %></p>
				<% end -%>
			<% end -%>
		</div>

	</div>

</body>
</html>
